package com.xinsoft.service.impl;

import cn.hutool.core.util.StrUtil;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.xinsoft.entity.dto.QuaPatrolStandardParam;
import com.xinsoft.entity.po.QuaPatrolStandard;
import com.xinsoft.service.QuaPatrolStandardService;
import com.xinsoft.mapper.QuaPatrolStandardMapper;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;

/**
* @author lijie
* @description 针对表【qua_patrol_standard(质量巡检标准表)】的数据库操作Service实现
* @createDate 2023-08-01 09:45:26
*/
@Service
public class QuaPatrolStandardServiceImpl extends ServiceImpl<QuaPatrolStandardMapper, QuaPatrolStandard>
    implements QuaPatrolStandardService{
    @Resource
    QuaPatrolStandardMapper standardMapper;
    @Override
    public Object findPageListByParam(QuaPatrolStandardParam param) {
        //分页
        Page<QuaPatrolStandard> page = new Page<QuaPatrolStandard>(param.getCurrentPage(), param.getPageSize());
        LambdaQueryWrapper<QuaPatrolStandard> queryWrapper = new LambdaQueryWrapper<>();
        //查询条件
        queryWrapper
                .like(StrUtil.isNotBlank(param.getStandardName()),QuaPatrolStandard::getStandardName,param.getStandardName());
        IPage<QuaPatrolStandard> resultPage = standardMapper.selectPage(page, queryWrapper);
        //返回值
        return resultPage;
    }
}




